<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/vue@3.2.47/dist/vue.global.js"></script>
    <title>vue商品页</title>
</head>

<style>
    * {
        list-style: none;
    }

    body {
        margin: 0;
        padding: 0;
    }

    .main {
        width: 400px;
        height: 600px;
        margin: auto;
        display: flex;
        flex-direction: column;
        border-radius: 20px;
    }

    .title {
        width: 400px;
        height: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 20px;

    }

    .goods {
        width: 400px;
        height: 150px;
        display: flex;
        justify-content: center;
        align-items: center;
        align-content: center;
        margin-top: 20px;
    }

    .left {
        display: flex;
        width: 120px;
        height: 120px;
    }

    .right {
        width: 240px;
        height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }


    .price {
        color: red;
        font-size: 20px;
        font-weight: 1000;
    }

    .bottom {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    .buy {
        width: 50px;
        color: white;
        background-color: gray;
        border: none;
    }

    .buy:hover {
        background-color: cadetblue;
    }
</style>

<body id="app">
    <div class="main">
        <div class="title">商品列表</div>
        <div class="goods">
            <div v-html="image" class="left"></div>
            <div class="right">
                <span v-html="description" v-bind:[symble]="style[0]">{{description}}</span>
                <div class="bottom">
                    <span v-html="price" v-bind:[symble]="style[1]">{{price}}</span>
                    <button class="buy">购买</button>
                </div>
            </div>
        </div>

        <div class="goods">
            <div v-html="image" class="left"></div>
            <div class="right">
                <span v-html="description" v-bind:[symble]="style[0]">{{description}}</span>
                <div class="bottom">
                    <span v-html="price" v-bind:[symble]="style[1]">{{price}}</span>
                    <button class="buy">购买</button>
                </div>
            </div>
        </div>

        <div class="goods">
            <div v-html="image" class="left"></div>
            <div class="right">
                <span v-html="description" v-bind:[symble]="style[0]">{{description}}</span>
                <div class="bottom">
                    <span v-html="price" v-bind:[symble]="style[1]">{{price}}</span>
                    <button class="buy">购买</button>
                </div>
            </div>
        </div>
    </div>

</body>
<script>
    Vue.createApp({
        data: () => {
            return {
                image: "<img src='./1.jpg' alt=''>",
                description: "<span>中分头背带裤，我叫ikun你记住!</span>",
                price: "<span>9.99$</span>",
                buy: "购买",
                style: ["description", "price"],
                symble: "class",
            }
        },
    }).mount('#app')


</script>

</html>